//九九乘法表
for (let i=1;i<10;i++) {
    line = ''
    for (let j=1;j<=i;j++) {
        line += `${j}*${i}=${i*j} `
    }
    console.log(line);
}

//排序
let arr = [9,7,12,3,1,8,15,20,31]
let b = 0
for (var i=0;i<arr.length;i++){
    for (var j=0;j<arr.length;j++){
        if(arr[j]>arr[j+1]){
            b = arr[j]
            arr[j] = arr[j+1]
            arr[j+1] = b
        }
    }
}

console.log(arr);



